package com.ftg.learn.service;

import com.ftg.learn.mapper.UserMapper;
import com.ftg.learn.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserSercice {
    @Autowired
    UserMapper usermapper;
    //通过前台数据得到User_id。
    public User login(String user_name,String user_password){
        User list=usermapper.login(user_name,user_password);
        return list;
    }
    //通过前台数据验证账号及密码是否正确。
    public int check(String user_name, String user_password){
        User list=usermapper.login(user_name,user_password);
        if(list == null){
            return 0;}
        else{
            return 1;
        }
    }

}
